<?php

namespace app\agent\validate;

use think\Validate;

class BalanceWarningConfig extends Validate
{
    protected $rule = [
        'status' => 'require|in:1,2',
        'balance' => 'require|egt:0|regex:\d{1,}([.]{1}[0-9]{1,2})?|elt:1000000',
        'mobile' => 'require'
    ];

    protected $message = [
        'status.require' => '请选择状态',
        'status.in' => '状态有误',
        'balance.require' => '请填写余额预警值',
        'balance.regex' => '余额预警值格式有误',
        'balance.egt' => '余额预警值不能小于 0',
        'balance.elt' => '余额预警值不能大于 100 万',
        'mobile.require' => '请填写预警手机号',
    ];

    protected $scene = [
        'set' => [
            'status',
            'balance',
            'mobile',
        ]
    ];
}
